package com.ship.dispatch.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.ship.common.core.constant.ShipApiConstants;
import com.ship.common.core.utils.OkHttpUtil;
import com.ship.dispatch.enums.NotifyType;
import com.ship.dispatch.service.MovingCloudService;
import cn.hutool.http.webservice.SoapClient;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import org.apache.commons.collections4.map.HashedMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import java.io.*;

import java.util.Map;

/**
 * <b>MovingCloudServiceImpl</b>
 *
 * @description: MovingCloudServiceImpl <br>
 * @date: 2024/4/2 10:18 <br>
 * @author: lhm <br>
 * @version: 1.0 <br>
 */

@Service
public class MovingCloudServiceImpl implements MovingCloudService {

    private static final Logger logger = LoggerFactory.getLogger(MovingCloudServiceImpl.class);

    public static String pushNotify(String senderAccount, String recipientAccount, NotifyType notifyType, String message, Map<String,String> extra) {
        SoapClient client = SoapClient.create("https://mdev.cnooc.com.cn/mp/api/common?wsdl")
                // 设置要请求的方法，传入对应的命名空间
                .setMethod("pushNotify", "http://mobile.cnooc.com.cn/api/common")
                // 设置参数
                .setParam("senderAccount", "qd_lngyscbdd_push")
                .setParam("recipientAccount", "ex_wuwh2")
                .setParam("notifyType", "MESSAGE")
                .setParam("message", "哈哈哈")
                .setParam("Extra", null);
        String result = client.send();
        System.out.println(result);
        return null;
    }

    public static void main(String[] args) throws IOException {
    }

}
